home *** CD-ROM | disk | FTP | other *** search
/ PC Play 129 / pc play 129.iso / Demo / man2 / man2.exe / scenarios / train / Train 08.scl < prev    next >
Encoding:
Text File  |  2005-03-07  |  22.6 KB  |  543 lines

  1. scenario = GetProperties()
  2. scenario.ScenarioType = 1
  3. scenario.Title = "sc_Train_08_00"
  4. scenario.Map = "Beotorum.dat"
  5. scenario.Description = "sc_Train_08_01"
  6. scenario.Picture = "Train 08.dds"
  7. scenario.iSortOrder = 8
  8.  
  9. scenario.vShowMessageBoxes[STDDT_GUERILLA] = false
  10. scenario.vShowMessageBoxes[STDDT_COMBAT_PHASE] = false
  11. scenario.vShowMessageBoxes[STDDT_SHOW_REVENUE] = false
  12. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_GUERILLA] = false
  13. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_COMBAT] = false
  14. scenario.vShowMessageBoxes[STDDT_AUTOFINISH_REVENUE] = false
  15. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_CAPITAL] = false
  16. scenario.vShowMessageBoxes[STDDT_YOU_CLEARED_TERRITORY] = false
  17. scenario.vShowMessageBoxes[STDDT_YOU_CAPTURED_COUNTRY] = false
  18. scenario.vShowMessageBoxes[STDDT_ENEMY_CLEARED_TERRITORY] = false
  19. scenario.vShowMessageBoxes[STDDT_ENEMY_INVADED] = false
  20. scenario.vShowMessageBoxes[STDDT_ENEMY_CAPTURED_COUNTRY] = false
  21. scenario.vShowMessageBoxes[STDDT_INVADE_COUNTRY] = false
  22.  
  23. Player(PT_PLAYER, RACE_HUMANS)
  24. Player(PT_AI, RACE_ALIENS)
  25.  
  26. --SetInitialCamera(-0.739249, 0.000000, -0.673431, 0.000000, 0.662946, 0.175779, -0.727739, 0.000000,0.118375, -0.984429, -0.129945, 0.000000,1199.751465, 548.634888, -809.019043, 1.000000)
  27. SetInitialCamera(-0.627260, 0.000000, 0.778810, 0.000000, -0.443819, 0.821736, -0.357455, 0.000000,-0.639976, -0.569868, -0.515443, 0.000000,1938.187378, 414.941132, -72.365982, 1.000000)
  28. function InitialMOB()
  29.     StartMOB(1)
  30.  
  31.     SetupUnit( 4098, NTRANSP, 1, 9 )
  32.     SetupUnit( 4099, HBOT, 1, 9 )
  33.     SetupUnit( 4100, HBOT, 1, 9 )
  34.  
  35.     ShowXBallon(4, -1, MBS_CENTER, 455, 405, "sc_Train_08_02")
  36.     ShowXBallon(4, -1, MBS_CENTER, 455, 405,"sc_Train_08_03")
  37.     ShowXBallon(4, -1, MBS_CENTER, 455, 405, "sc_Train_08_04")
  38.         InitCameraPointsList()
  39.         AddCameraPoint(-0.892210, 0.000000, 0.451620, 0.000000, -0.371274, 0.569354, -0.733479, 0.000000,-0.257132, -0.822093, -0.507983, 0.000000,1049.038330, 392.638672, -497.366913, 1.000000)
  40.         AddCameraPoint(-0.689769, 0.000000, -0.724030, 0.000000, 0.389692, 0.842800, -0.371252, 0.000000,0.610213, -0.538226, -0.581337, 0.000000,1174.002563, 196.914566, -791.180054, 1.000000)
  41.         FlyCameraByPoints(1.0)
  42.     Disclose( 4 )
  43.  
  44.     ShowXBallon(4, -1, MBS_CENTER, 599, 381, "sc_Train_08_05")
  45.  
  46.     SetupUnit(1, AMPHIBIAA, 19, 25)
  47.     pause(0.8)
  48.     SetupUnit(2, AMPHIBIAA, 20, 24)
  49.     pause(0.8)
  50.     SetupUnit(3, TANKA, 21, 23)
  51.  
  52.     ShowXBallon(4, -1, MBS_CENTER, 430, 415,"sc_Train_08_06")
  53.         FlyCamera(-0.681473, 0.000000, -0.731843, 0.000000, 0.694459, 0.315524, -0.646662, 0.000000,0.230914, -0.948918, -0.215021, 0.000000,1019.963379, 376.320465, -810.591431, 1.000000)
  54.         ShowObject(ARROW, 1, 16711680, 100, 50, 19, 23, 17, 21)
  55.     ShowXBallon(4, -1, MBS_CENTER, 698, 635,  "sc_Train_08_07")
  56.  
  57.         HideObject(1)
  58.     ShowXBallon(4, -1, MBS_CENTER, 698, 635, "sc_Train_08_08")
  59.  
  60.  
  61.     --FlyCamera(-0.603659, 0.000000, -0.797243, 0.000000, 0.784827, 0.175794, -0.594258, 0.000000,0.140150, -0.984427, -0.106120, 0.000000,67.101639, 548.634888, -488.771393, 1.000000)
  62.         FlyCamera(-0.823319, -0.000000, -0.567579, 0.000000, 0.473305, 0.551914, -0.686566, 0.000000,0.313255, -0.833901, -0.454401, 0.000000,36.259396, 163.291489, -269.244568, 1.000000)
  63.  
  64.     ShowXBallon(4, -1, MBS_LEFT, 522, 480,"sc_Train_08_09")
  65.         SetCamera(-0.469045, 0.000000, -0.883174, 0.000000, 0.820617, 0.369658, -0.435822, 0.000000,0.326472, -0.929168, -0.173386, 0.000000,-71.434784, 524.918335, -474.589264, 1.000000)
  66.         ShowObject(ARROW, 2, 65280, 100, 70, 0, 10, 0, 16)
  67.         ShowObject(ARROW, 3, 65280, 100, 70, 0, 16, 5, 21)
  68.         pause(2.0)
  69.         HideObject(2)
  70.         HideObject(3)
  71.     FinishMOB()
  72. end
  73.  
  74. old_prompt = ""
  75.  
  76. local bCanEndPhase = false
  77.  
  78. function OnUpdate()
  79.     bCanEndPhase = false
  80.  
  81.     if GetTurnNumber(COLOR_GREEN) == 0 then
  82.         if GetGamePhase() == PHASE_DEPLOYMENT then
  83.             if GetSelectedCountry() ~= 5 and GetMoney(5, MONEY_BANK) > 0 then
  84.                 ShowPrompting("sc_Train_08_10")
  85.             elseif GetMoney(5, MONEY_BANK) > 0 then
  86.                 ShowPrompting("sc_Train_08_11")
  87.             end
  88.         end
  89.     elseif GetTurnNumber(COLOR_GREEN) == 1 then
  90.         if GetGamePhase() == PHASE_GUERRILLA then
  91.             if GetMoney(5, MONEY_GUERRILLA) > 0 then
  92.                 ShowPrompting("sc_Train_08_12")
  93.             end
  94.         elseif GetGamePhase() == PHASE_COMBAT then
  95.             if IsAlive( 1 ) then
  96.                 ShowPrompting("sc_Train_08_13")
  97.             elseif GetHP( 2 ) == 4 then
  98.                 ShowPrompting("sc_Train_08_14")
  99.             end
  100.         end
  101.     elseif GetTurnNumber(COLOR_GREEN) == 2 then
  102.         if GetMP( 4098 ) > 0 then    
  103.             ShowPrompting("sc_Train_08_15")
  104.         elseif IsInside( 4099 ) or IsInside( 4100 ) then    
  105.             ShowPrompting("sc_Train_08_16")
  106.         elseif IsAlive( 2 ) then
  107.             ShowPrompting("sc_Train_08_17")
  108.         elseif IsHexFull( 20, 22 ) == 0 then
  109.             ShowPrompting("sc_Train_08_18")
  110.         elseif IsHexFull( 19, 23 ) == 0 then
  111.             ShowPrompting("sc_Train_08_19")
  112.         elseif IsHexFull( 18, 22 ) == 0 then
  113.             ShowPrompting("sc_Train_08_20")
  114.         else
  115.             for id = 4101, 4106 do
  116.                 if IsAlive( id ) and not HasFired( id ) then
  117.                     ShowPrompting("sc_Train_08_21")
  118.                     break
  119.                 end
  120.             end
  121.         end
  122.     elseif GetTurnNumber(COLOR_GREEN) == 3 then
  123.         if GetGamePhase() == PHASE_COMBAT then
  124.             if GetCountryControl( 5 ) ~= COLOR_GREEN then
  125.                 ShowPrompting("sc_Train_08_22")
  126.             end
  127.         elseif GetGamePhase() == PHASE_DEPLOYMENT then
  128.             if GetMoney(5, MONEY_BANK) > 0 then
  129.                 ShowPrompting("sc_Train_08_23")
  130.             end
  131.         end
  132.     end
  133.  
  134.     if not HasPrompting() then
  135.         if GetGamePhase() == PHASE_COMBAT and GetMP( 4098 ) > 0 then
  136.             ShowPrompting("sc_Train_08_24")
  137.         else
  138.             ShowPrompting("sc_Train_finish_phase")
  139.             bCanEndPhase = true
  140.         end
  141.     end
  142. end
  143.  
  144. local bEqualFinalTanks = false
  145.  
  146. function OnHexClicked(x, y, clicked_unit, selected_unit, command)
  147.  
  148.     if command == CMD_SELECT_COUNTRY and clicked_unit == 5 then
  149.         if GetTurnNumber( COLOR_GREEN ) == 0 and GetGamePhase() == PHASE_DEPLOYMENT then
  150.             StartMOB(3)
  151.             ShowXBallon(51, -1, MBS_RIGHT, 756, 421, "sc_Train_08_26")
  152.             ShowXBallon(51, -1, MBS_CENTER, 335, 400, "sc_Train_08_27")
  153.             ShowXBallon(51, -1, MBS_CENTER, 335, 400, "sc_Train_08_28")
  154.             ShowXBallon(51, -1, MBS_CENTER, 335, 400, "sc_Train_08_29")
  155.             ShowXBallon(51, -1, MBS_CENTER, 335, 400, "sc_Train_08_30")
  156.             ShowXBallon(51, -1, MBS_CENTER, 335, 430,  "sc_Train_08_31")
  157.             FinishMOB()
  158.         end
  159.     end
  160.  
  161.     if command == CMD_SETUP and GetType(selected_unit) ~= LBOT then
  162.         IncorrectAction("sc_Train_08_32")
  163.         return
  164.     end
  165.  
  166.     if command == CMD_MOVE then
  167.         if GetCountry( x, y ) == 4 then
  168.             IncorrectAction("sc_Train_08_33")
  169.             return
  170.         end
  171.     end
  172.  
  173.     if GetTurnNumber(COLOR_GREEN) == 0 then
  174.         if command == CMD_MOVE then
  175.             if selected_unit == 4098 then
  176.                 if x ~= 2 or y ~= 18 then
  177.                     IncorrectAction("sc_Train_08_34")
  178.                 end
  179.             end
  180.         elseif command == CMD_SETUP then
  181.             if not ( x == 20 and y == 22 or x == 19 and y == 23 ) then
  182.                 IncorrectAction("sc_Train_08_35")
  183.             end
  184.         end
  185.     elseif GetTurnNumber(COLOR_GREEN) == 1 then
  186.         if command == CMD_SETUP then
  187.             if not ( x == 19 and y == 23 or x == 18 and y == 22 or x == 18 and y == 20 or x == 17 and y == 23 ) then
  188.                 IncorrectAction("sc_Train_08_35")
  189.             end
  190.         elseif command == CMD_MOVE then
  191.             if GetType( selected_unit ) == LBOT then
  192.                 IncorrectAction("sc_Train_08_37")
  193.             elseif selected_unit == 4098 then
  194.                 if x ~= 8 or y ~= 20 then
  195.                     IncorrectAction("sc_Train_08_34")
  196.                 end
  197.             end
  198.         elseif command == CMD_FIRE then
  199.             if GetDistance(1, selected_unit) == 1 and clicked_unit ~= 1 then
  200.                 IncorrectAction("sc_Train_08_39")
  201.             end
  202.         end
  203.     elseif GetTurnNumber(COLOR_GREEN) == 2 then
  204.         if command == CMD_SELECT then
  205.             if GetType( clicked_unit ) == LBOT and IsAlive( 2 ) then
  206.                 if IsInside( 4099 ) or IsInside( 4100 ) then
  207.                     StartMOB(1)
  208.                     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_40")
  209.                     FinishMOB()
  210.                 else
  211.                     StartMOB(1)
  212.                     ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_41")
  213.                     FinishMOB()
  214.                 end
  215.             end
  216.         elseif command == CMD_FIRE then
  217.             if GetType( selected_unit ) == LBOT then
  218.                 if GetMP( selected_unit ) == 10 then
  219.                     IncorrectAction("sc_Train_08_42")
  220.                 elseif clicked_unit == 4 then
  221.                     local p = GetPos( selected_unit )
  222.                     if p.x == 19 and p.y == 23 then
  223.                         IncorrectAction("sc_Train_08_43")
  224.                     end
  225.                 end
  226.             end
  227.         elseif command == CMD_MOVE then
  228.             if selected_unit == 4098 then
  229.                 if x ~= 14 or y ~= 22 then
  230.                     IncorrectAction("sc_Train_08_44")
  231.                 end
  232.             elseif GetType( selected_unit ) == LBOT then
  233.                 if IsHexFull( 20, 22 ) == 0 then
  234.                     if x ~= 20 or y ~= 22 then
  235.                         IncorrectAction("sc_Train_08_35")
  236.                     end
  237.                 elseif IsHexFull( 19, 23 ) == 0 then
  238.                     if x ~= 19 or y ~= 23 then
  239.                         IncorrectAction("sc_Train_08_35")
  240.                     end
  241.                 elseif IsHexFull( 18, 22 ) == 0 then
  242.                     if x ~= 18 or y ~= 22 then
  243.                         IncorrectAction("sc_Train_08_35")
  244.                     end
  245.                 end
  246.             end
  247.         end
  248.     elseif GetTurnNumber(COLOR_GREEN) == 3 then
  249.         if command == CMD_FIRE then
  250.             local p = GetPos( clicked_unit )
  251.             if GetCountry( p.x, p.y ) ~= 5 then
  252.                 IncorrectAction("sc_Train_08_48")
  253.                 return
  254.             elseif GetType( selected_unit ) == HBOT and GetHP( clicked_unit ) < 3 then
  255.                 IncorrectAction("sc_Train_08_49")
  256.                 return
  257.             end
  258.         elseif command == CMD_MOVE then
  259.             local p = GetPos( selected_unit )
  260.             if p.x + p.y == 42 and x + y ~= 42 then
  261.                 IncorrectAction("sc_Train_08_50")
  262.                 return
  263.             elseif p.x == 15 and p.y == 21 then
  264.                 if x ~= 17 or y ~= 21 then
  265.                     IncorrectAction("sc_Train_08_35")
  266.                     return
  267.                 end
  268.             elseif p.x == 15 and p.y == 23 then
  269.                 if x ~= 16 or y ~= 24 then
  270.                     IncorrectAction("sc_Train_08_35")
  271.                     return
  272.                 end
  273.             end
  274.         end
  275.  
  276.         local p = GetPos( selected_unit )
  277.  
  278.         if bEqualFinalTanks then
  279.             if command == CMD_FIRE then
  280.                 if GetType( selected_unit ) == LBOT and p.x + p.y < 42 then
  281.                     if clicked_unit ~= 3 then
  282.                         IncorrectAction("sc_Train_08_49")
  283.                     end
  284.                 elseif ( p.x == 15 and p.y == 23 ) or ( p.x == 16 and p.y == 24 ) then
  285.                     if IsHexFull( 17, 23 ) == 0 and GetType( IsHexFull( 17, 21 ) ) ~= HBOT and clicked_unit ~= 5 then
  286.                         IncorrectAction("sc_Train_08_49")
  287.                     end
  288.                 end
  289.             elseif command == CMD_MOVE then
  290.                 if GetType( selected_unit ) == LBOT and p.x + p.y < 42 then
  291.                     if GetDistance( 3, x, y ) > 1 then
  292.                         IncorrectAction("sc_Train_08_49")
  293.                     end
  294.                 end
  295.             end
  296.         else
  297.             if command == CMD_MOVE then
  298.                 if p.x == 18 and p.y == 22 then
  299.                     IncorrectAction("sc_Train_08_35")
  300.                 end
  301.             end
  302.         end
  303.  
  304.         if command == CMD_SETUP then
  305.             if x + y ~= 42 then
  306.                 IncorrectAction("sc_Train_08_35")
  307.             end
  308.         end
  309.     end
  310. end
  311.  
  312. function OnBeginPhase(phase)
  313.     if GetTurnNumber( COLOR_GREEN ) == 0 and phase == PHASE_DEPLOYMENT then
  314.         StartMOB(1)
  315.         FlyCamera(-0.576080, -0.000000, -0.817393, 0.000000, 0.808513, 0.147006, -0.569821, 0.000000,0.120161, -0.989135, -0.084687, 0.000000,1119.200439, 468.516541, -778.856018, 1.000000)
  316.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_51")
  317.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_52")
  318.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_53")
  319.         FinishMOB()
  320.     elseif GetTurnNumber( COLOR_GREEN ) == 1 then
  321.         if phase == PHASE_GUERRILLA then
  322.             StartMOB(1)
  323.             ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_54")
  324. --            ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_55")
  325.                         ShowXBallon(51, -1, MBS_CENTER, 342, 548, "sc_Train_08_55")
  326.                         FlyCamera(-0.636797, -0.000000, -0.771031, 0.000000, 0.769098, 0.070762, -0.635201, 0.000000,0.054559, -0.997493, -0.045060, 0.000000,1195.325317, 372.394836, -774.063049, 1.000000)
  327. --            FlyCamera(-0.636797, -0.000000, -0.771031, 0.000000, 0.769098, 0.070762, -0.635201, 0.000000,0.054559, -0.997493, -0.045060, 0.000000,1195.325317, 372.394836, -774.063049, 1.000000)  
  328. --            FlyCamera(-0.636797, -0.000000, -0.771031, 0.000000, 0.769098, 0.070762, -0.635201, 0.000000,0.054559, -0.997493, -0.045060, 0.000000,1195.325317, 372.394836, -774.063049, 1.000000)
  329.             ShowXBallon(51, -1, MBS_RIGHT, 537, 361, "sc_Train_08_56")
  330. --            FlyCamera(-0.636797, 0.000000, -0.771031, 0.000000, 0.769098, 0.070761, -0.635201, 0.000000,0.054559, -0.997493, -0.045060, 0.000000,1167.451660, 468.516541, -750.093201, 1.000000)
  331.                         FlyCamera(-0.785841, 0.000000, -0.618428, 0.000000, 0.616879, 0.070738, -0.783872, 0.000000,0.043746, -0.997495, -0.055588, 0.000000,1184.111450, 333.194489, -740.528198, 1.000000)
  332.             ShowXBallon(51, -1, MBS_LEFT, 506, 393, "sc_Train_08_57")
  333. --            ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_57")
  334.             ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_58")
  335.             FinishMOB()
  336.         elseif phase == PHASE_COMBAT then
  337.             StartMOB(1)
  338. --            FlyCamera(-0.785841, 0.000000, -0.618428, 0.000000, 0.616879, 0.070738, -0.783872, 0.000000,0.043746, -0.997495, -0.055588, 0.000000,1184.111450, 333.194489, -740.528198, 1.000000)
  339. --            ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_59")
  340.                         FlyCamera(-0.785841, 0.000000, -0.618428, 0.000000, 0.616879, 0.070738, -0.783872, 0.000000,0.043746, -0.997495, -0.055588, 0.000000,1184.111450, 333.194489, -740.528198, 1.000000)
  341.             ShowXBallon(51, -1, MBS_LEFT, 506, 393, "sc_Train_08_59")
  342.             FinishMOB()
  343.         end
  344.     elseif GetTurnNumber( COLOR_GREEN ) == 2 then
  345.         if phase == PHASE_COMBAT then
  346.             StartMOB(1)
  347. --            FlyCamera(-0.682476, 0.000000, -0.730908, 0.000000, 0.717182, 0.192890, -0.669660, 0.000000,0.140985, -0.981220, -0.131643, 0.000000,650.349792, 444.205231, -706.140564, 1.000000)
  348.                         FlyCamera(-0.682476, 0.000000, -0.730908, 0.000000, 0.717182, 0.192890, -0.669660, 0.000000,0.140985, -0.981220, -0.131643, 0.000000,650.349792, 444.205231, -706.140564, 1.000000)
  349.             FinishMOB()
  350.         end
  351.     elseif GetTurnNumber( COLOR_GREEN ) == 3 then
  352.         if phase == PHASE_COMBAT then
  353.             StartMOB(1)
  354.                         FlyCamera(-0.565817, 0.000000, -0.824531, 0.000000, 0.782304, 0.315918, -0.536839, 0.000000,0.260484, -0.948786, -0.178752, 0.000000,880.344727, 329.312653, -831.693237, 1.000000)
  355.                         SelectUnit(3)
  356.                         SelectUnit(5)
  357.                         SelectUnit(4099)
  358.                         SelectUnit(4100)
  359.                         SelectUnit(4105)
  360.             ShowXBallon(51, -1, MBS_CENTER, 693, 416, "sc_Train_08_60")
  361.                         UnselectUnit(3)
  362.                         UnselectUnit(5)
  363.                         UnselectUnit(4099)
  364.                         UnselectUnit(4100)   
  365.                         UnselectUnit(4105)      
  366.  
  367.             if GetHP( 3 ) == GetHP( 5 ) then
  368.                 bEqualFinalTanks = true
  369.             else
  370.                 bEqualFinalTanks = false
  371.             end
  372.                     
  373.             FinishMOB()
  374.         end
  375.     elseif GetCountryControl( 5 ) == COLOR_GREEN and phase == PHASE_DEPLOYMENT then
  376.         StartMOB(1)
  377.                 FlyCamera(0.557139, 0.000000, -0.830419, 0.000000, 0.812109, 0.208833, 0.544855, 0.000000,0.173419, -0.977951, 0.116349, 0.000000,986.574280, 352.915955, -793.248901, 1.000000)
  378. --        FlyCamera(0.557139, 0.000000, -0.830419, 0.000000, 0.812109, 0.208833, 0.544855, 0.000000,0.173419, -0.977951, 0.116349, 0.000000,986.574280, 352.915955, -793.248901, 1.000000)
  379.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_61")
  380. --        FlyCamera(-0.870180, 0.000000, -0.492733, 0.000000, 0.478493, 0.238675, -0.845032, 0.000000,0.117603, -0.971099, -0.207690, 0.000000,1218.958130, 352.915955, -800.158997, 1.000000)
  381.                 FlyCamera(-0.870180, 0.000000, -0.492733, 0.000000, 0.478493, 0.238675, -0.845032, 0.000000,0.117603, -0.971099, -0.207690, 0.000000,1218.958130, 352.915955, -800.158997, 1.000000)
  382.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_62")
  383.         FinishMOB()
  384.     end
  385. end
  386.  
  387. local bVictory = false
  388.  
  389. function OnEndTurn()
  390.     if GetTurnNumber( COLOR_GREEN ) == 0 then
  391.         StartMOB(1)
  392. --        FlyCamera(0.778401, 0.000000, 0.627767, 0.000000, -0.571288, 0.414540, 0.708369, 0.000000,-0.260234, -0.910031, 0.322678, 0.000000,1297.226318, 368.439240, -940.557983, 1.000000)
  393.                 FlyCamera(0.778401, 0.000000, 0.627767, 0.000000, -0.571288, 0.414540, 0.708369, 0.000000,-0.260234, -0.910031, 0.322678, 0.000000,1297.226318, 368.439240, -940.557983, 1.000000)
  394.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_63")
  395.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_64")
  396.         FinishMOB()
  397.     elseif GetTurnNumber( COLOR_GREEN ) == 1 then
  398.         StartMOB(1)
  399.                 FlyCamera(-0.725853, 0.000000, -0.687849, 0.000000, 0.683808, 0.108240, -0.721589, 0.000000,0.074453, -0.994125, -0.078567, 0.000000,1085.912231, 420.161469, -697.990784, 1.000000)
  400. --        FlyCamera(-0.725853, 0.000000, -0.687849, 0.000000, 0.683808, 0.108240, -0.721589, 0.000000,0.074453, -0.994125, -0.078567, 0.000000,1085.912231, 420.161469, -697.990784, 1.000000)
  401.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_65")
  402.         FinishMOB()
  403.     elseif GetCountryControl( 5 ) ~= COLOR_GREEN then
  404.         StartMOB(1)
  405. --        FlyCamera(-0.725853, 0.000000, -0.687849, 0.000000, 0.683808, 0.108240, -0.721589, 0.000000,0.074453, -0.994125, -0.078567, 0.000000,1085.912231, 420.161469, -697.990784, 1.000000)
  406.                 FlyCamera(-0.725853, 0.000000, -0.687849, 0.000000, 0.683808, 0.108240, -0.721589, 0.000000,0.074453, -0.994125, -0.078567, 0.000000,1085.912231, 420.161469, -697.990784, 1.000000)
  407.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_66")
  408.         FinishMOB()
  409.     elseif IsHexFull(20, 22) > 0 and IsHexFull(19, 23) > 0 and IsHexFull(18, 24) > 0 then
  410.         StartMOB(1)
  411.         bVictory = true
  412.                 FlyCamera(-0.997166, -0.000000, 0.075230, 0.000000, -0.071749, 0.300650, -0.951032, 0.000000,-0.022618, -0.953734, -0.299798, 0.000000,1147.969604, 397.740173, -659.337524, 1.000000) 
  413. --        FlyCamera(-0.997166, -0.000000, 0.075230, 0.000000, -0.071749, 0.300650, -0.951032, 0.000000,-0.022618, -0.953734, -0.299798, 0.000000,1147.969604, 397.740173, -659.337524, 1.000000)
  414.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_67")
  415.         FinishMOB()
  416.     end
  417. end
  418.  
  419. function OnEndAITurn()
  420.     if GetTurnNumber( COLOR_RED ) == 0 then
  421.         StartMOB(1)
  422.                 FlyCamera(0.929103, 0.000000, 0.369820, 0.000000, -0.243303, 0.753109, 0.611254, 0.000000,-0.278515, -0.657896, 0.699716, 0.000000,1416.715942, 263.430267, -1048.033936, 1.000000)
  423.         ShowXBallon(51, -1, MBS_LEFT, 383, 505, "sc_Train_08_68")
  424.         FinishMOB()
  425.     elseif GetTurnNumber( COLOR_RED ) == 1 then
  426.         StartMOB(1)
  427. --        FlyCamera(0.924687, -0.000000, -0.380729, 0.000000, 0.371557, 0.218184, 0.902409, 0.000000,0.083069, -0.975908, 0.201751, 0.000000,1280.760376, 419.045532, -974.900085, 1.000000)
  428.                 FlyCamera(0.924687, -0.000000, -0.380729, 0.000000, 0.371557, 0.218184, 0.902409, 0.000000,0.083069, -0.975908, 0.201751, 0.000000,1280.760376, 419.045532, -974.900085, 1.000000)
  429.                 FlyCamera(0.914649, 0.000000, -0.404249, 0.000000, 0.368973, 0.408545, 0.834835, 0.000000,0.165154, -0.912738, 0.373676, 0.000000,1163.519653, 419.665009, -962.705139, 1.000000)
  430.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_69")
  431.         FinishMOB()
  432.     elseif GetTurnNumber( COLOR_RED ) == 2 then
  433.         StartMOB(1)
  434.         SetMP(4098, 0)
  435.         FinishMOB()
  436.     end
  437. end
  438.  
  439. function OnCountryInvaded(country, color)
  440.     if country == 5 then
  441.         StartMOB(1)
  442. --        FlyCamera(0.746720, -0.000000, 0.665138, 0.000000, -0.640953, 0.267205, 0.719569, 0.000000,-0.177728, -0.963640, 0.199528, 0.000000,1411.109985, 331.871033, -927.953186, 1.000000)
  443.                 FlyCamera(-0.715551, 0.000000, -0.698560, 0.000000, 0.331726, 0.880055, -0.339794, 0.000000,0.614772, -0.474871, -0.629725, 0.000000,1035.700928, 187.793503, -721.002197, 1.000000)
  444.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_70")
  445.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_71")
  446.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_72")
  447.         FinishMOB()
  448.     end
  449. end
  450.  
  451. function OnUnitDead(unit)
  452.     if GetTurnNumber( COLOR_RED ) == 0 then
  453.         StartMOB(1)
  454. --        FlyCamera(0.515332, -0.000000, 0.856990, 0.000000, -0.854843, 0.070751, 0.514041, 0.000000,-0.060632, -0.997494, 0.036460, 0.000000,1302.369019, 335.710144, -882.839355, 1.000000)
  455.                 FlyCamera(0.952639, 0.000000, -0.304103, 0.000000, 0.176944, 0.813292, 0.554298, 0.000000,0.247324, -0.581855, 0.774774, 0.000000,1189.479004, 246.053589, -1025.821533, 1.000000)
  456.         ShowXBallon(51, -1, MBS_LEFT, 431, 646,  "sc_Train_08_73")
  457.         FinishMOB()
  458.     elseif unit == 2 then
  459.         if IsHexFull(18, 20) > 0 then
  460.             StartMOB(1)
  461. --            FlyCamera(-0.725853, 0.000000, -0.687849, 0.000000, 0.683808, 0.108240, -0.721589, 0.000000,0.074453, -0.994125, -0.078566, 0.000000,1174.037598, 392.638672, -796.555786, 1.000000)
  462.                         FlyCamera(-0.725853, 0.000000, -0.687849, 0.000000, 0.683808, 0.108240, -0.721589, 0.000000,0.074453, -0.994125, -0.078566, 0.000000,1174.037598, 392.638672, -796.555786, 1.000000)
  463.                         
  464.                         ShowObject(ARROW, 7, 65280, 100, 20, 19, 23, 20, 22)
  465.             ShowXBallon(51, -1, MBS_LEFT, 340, 363, "sc_Train_08_74")
  466. --            ShowXBallon(51, -1, MBS_CENTER, 300, 300, 
  467.             ShowXBallon(51, -1, MBS_LEFT, 523, 435, "sc_Train_08_75")
  468.                         ShowObject(ARROW, 8, 65280, 100, 20, 18, 22, 19, 23)
  469.                         ShowObject(ARROW, 8, 65280, 100, 20, 18, 20, 18, 22)
  470.         
  471.             ShowXBallon(51, -1, MBS_LEFT, 557, 621,  "sc_Train_08_76")
  472.                         HideObject(7)  
  473.                         HideObject(8)  
  474.                         HideObject(9)  
  475.             FinishMOB()
  476.         end
  477.     end
  478. end
  479.  
  480. function OnCountryCaptured(country, color)
  481.     if(country == 5 and color == COLOR_GREEN) then
  482.         StartMOB(1)
  483.         ShowXBallon(51, -1, MBS_CENTER, 300, 300, "sc_Train_08_77")
  484.         FinishMOB()
  485.     end
  486. end
  487.  
  488. function OnEndPhase( phase )
  489.     if phase == PHASE_COMBAT then
  490.         if not AllUnitsMovedAndFiredIfCould() then
  491.             IncorrectAction("sc_Train_08_35")
  492.         end
  493.     elseif phase == PHASE_DEPLOYMENT then
  494.         if GetCountryControl( 5 ) == COLOR_GREEN and GetMoney(5, MONEY_BANK) > 0 then
  495.             IncorrectAction("sc_Train_08_35")
  496.         end
  497.     end
  498. end
  499.  
  500. function CheckForVictory()
  501.     if bVictory then return GAMERESULT_VICTORY end
  502.     if GetAliveUnitsAmount(COLOR_GREEN) == 0 then return GAMERESULT_DEFEAT end
  503.     return GAMERESULT_NONE
  504. end
  505.  
  506. function aiDefence(country)
  507.     aiMustNot()
  508. end
  509.  
  510. function aiUnit(unit)
  511.     if GetTurnNumber( COLOR_GREEN ) == 1 then
  512.         if unit == 1 then
  513.             aiHexAttraction( 19, 21, 15 )
  514.         elseif unit == 2 then
  515.             aiHexAttraction( 18, 24, 15 )
  516.         elseif unit == 3 then
  517.             aiHexAttraction( 19, 25, 15 )
  518.         end
  519.     else
  520.         if unit == 4 then
  521.             aiHexAttraction( 20, 24, 15 )
  522.         else
  523.             aiHexAttraction( 16, 22, 15 )
  524.         end
  525.     end
  526. end
  527.  
  528. function aiMustBuyOnDeployment(country)
  529.     if GetTurnNumber( COLOR_GREEN ) == 1 then
  530.         aiMustBuy( TANKA, 20, 24 )
  531.     else
  532.         aiMustBuy( TANKA, 19, 25 )
  533.     end
  534. end
  535.  
  536. function InitialSetup()
  537.     Country(5, ALLIANCE_FNU_ALLY)
  538.     PlaceCapital(5, 16, 20)
  539.  
  540.     Country(4, ALLIANCE_FL_SECRET_ALLY)
  541.  
  542. end
  543.